From: Carlos Garnacho Date: Fri, 26 Sep 2025 02:42:47 +0000 (+0200) Subject: slider: Use actor relative coordinates when dragging X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~44^2~129 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=284d96ea8080e7c1628ce554db7bdbe7815a803f;p=gnome-shell.git slider: Use actor relative coordinates when dragging Stop working on absolute coordinates here, this is not necessary. Part-of: --- diff --git a/js/ui/slider.js b/js/ui/slider.js index ede76cca5..01bb7c8f8 100644 --- a/js/ui/slider.js +++ b/js/ui/slider.js @@ -87,7 +87,7 @@ export const Slider = GObject.registerClass({ // sure that no 'notify::value' signal is emitted before this one. this.emit('drag-begin'); - const coords = this._panGesture.get_centroid_abs(); + const coords = this._panGesture.get_centroid(); this._moveHandle(coords.x, coords.y); return Clutter.EVENT_STOP; } @@ -107,7 +107,7 @@ export const Slider = GObject.registerClass({ } _onPanUpdate() { - const coords = this._panGesture.get_centroid_abs(); + const coords = this._panGesture.get_centroid(); this._moveHandle(coords.x, coords.y); } @@ -161,13 +161,11 @@ export const Slider = GObject.registerClass({ return super.vfunc_key_press_event(event); } - _moveHandle(absX, _absY) { - let relX; - const [sliderX] = this.get_transformed_position(); + _moveHandle(x, _y) { const rtl = this.get_text_direction() === Clutter.TextDirection.RTL; const width = this._barLevelWidth; - relX = absX - sliderX; + let relX = x; if (rtl) relX = width - relX;